
<div class="eject_con">
    <div id="warning"></div>
    <form id="addclass_form" action="{:url('circle/manage/class_edit')}?c_id=<?php echo $c_id;?>" method="post" class="base-form-style">
        <input type="hidden" name="thc_id" value="<?php echo $thclass_info['thclass_id'];?>" />
        <dl>
            <dt>分类名称:</dt>
            <dd>
                <input type="text" name="name" class="w200 text" value="<?php echo $thclass_info['thclass_name'];?>" />
            </dd>
        </dl>
        <dl>
            <dt>分类排序:</dt>
            <dd>
                <input type="text" name="sort" class="w50 text" value="<?php echo $thclass_info['thclass_sort'];?>" />
            </dd>
        </dl>
        <dl>
            <dt>显示状态:</dt>
            <dd>
                <input type="radio" name="status" value="1" <?php if($thclass_info['thclass_status'] == 1){?>checked="checked"<?php }?> />
                是&nbsp;
                <input type="radio" name="status" value="0" <?php if($thclass_info['thclass_status'] == 0){?>checked="checked"<?php }?> />
                否 </dd>
        </dl>
        <dl class="bottom">
            <dt>&nbsp;</dt>
            <dd><a class="submit-btn" nctype="submit-btn" href="Javascript: void(0)">提交</a></dd>
        </dl>
    </form>
</div>
<script type="text/javascript">
    $(function(){
        $('a[nctype="submit-btn"]').click(function(){
            $('#addclass_form').submit();
        });
        $('#addclass_form').validate({
            errorLabelContainer: $('#warning'),
            invalidHandler: function(form, validator) {
                $('#warning').show();
            },
            submitHandler:function(form){
                ajaxpost('addclass_form', "<?php echo url('circle/manage/class_edit');?>?c_id=<?php echo $c_id;?>", '', 'onerror');
            },
            rules : {
                name : {
                    required : true,
                    maxlength : 4
                },
                sort : {
                    required : true,
                    digits : true,
                    max : 255
                }
            },
            messages : {
                name : {
                    required : '请填写分类名称',
                    maxlength : '分类名称不能超过4个字符'

                },
                sort  : {
                    required : '请填写分类排序',
                    digits : '请填写数字',
                    max : '数值不能超过255'
                }
            }
        });
    });
</script>